package com.imoresoft.magic.action;

import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;

import com.ambitor.grass.sql.dao.SuperDao;
import com.ambitor.grass.sql.dao.impl.SuperDaoImpl;
import com.ambitor.grass.util.data.DataMap;
import com.ambitor.grass.util.data.IData;

public class ArticleAction extends BaseAction {

	private static final long serialVersionUID = -7019725516934646023L;

	private SuperDao superDao;

	private Map<String, String> article = new HashMap<String, String>();

	public ArticleAction() throws SQLException {
		super();
		superDao = new SuperDaoImpl(pd.getConn());
	}

	@SuppressWarnings("unchecked")
	public String articleDetail() {
		String articleId = pd.getRequestParameter("article_id");
		IData param = new DataMap();
		param.put("ARTICLE_ID", articleId);
		try {
			article = superDao.queryByPK("TF_M_ARTICLE", param);
		} catch (Exception e) {
		}
		return "detail";
	}

	public void setArticle(Map<String, String> article) {
		this.article = article;
	}

	public Map<String, String> getArticle() {
		return article;
	}
}
